package com.zdlee.netty.server12.codec;

import com.zdlee.netty.server12.command.Packet;
import com.zdlee.netty.server12.command.PacketCodeC;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-11-29 16:16
 */
public class PacketEncoder extends MessageToByteEncoder<Packet> {

    @Override
    protected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out){
        PacketCodeC.INSTANCE.encode(out,msg);
    }

}
